package com.uzai.console.vo.login;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @Auther: jianghan
 * @Date: 2019/12/12 17:01
 * @Description:
 */
@ApiModel("登录响应")
public class LoginVo implements Serializable{

    private static final long serialVersionUID = 4014961586555930078L;
    @ApiModelProperty("当前登录id")
    private Long id;
    @ApiModelProperty("当前登录账号")
    private String loginName;
    @ApiModelProperty("运营商id")
    private Long merId;
    @ApiModelProperty("主账号")
    private String mobile;
    @ApiModelProperty("子账号id（子账号登录才有信息）")
    private Long accountId;
    @ApiModelProperty("子账号(登录账号)")
    private String accountUser;
    @ApiModelProperty("登录类型（0-主账号登录；1-子账号登录；2-悠聊账号登录")
    private Integer type;
    @ApiModelProperty("登录token")
    private String loginToken;
    @ApiModelProperty("是否发送短信验证(0-未发送;1-已发送)")
    private Integer sendSmsFlag;
    @ApiModelProperty("是否是系统默认密码登录（0-普通登录；1-系统默认密码登录；2-客服超级账号登录")
    private Integer loginByDefaultPassword;
    @ApiModelProperty("客服账号")
    private String managerMobile;
    @ApiModelProperty("当前账号创建时间")
    private Integer createTime;

    public Long getId() {
        if(id == null){
            if(type == 0){
                id = merId;     //主账号id
            }else{
                id = accountId; //子账号id
            }
        }
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMerId() {
        return merId;
    }

    public void setMerId(Long merId) {
        this.merId = merId;
    }

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        this.accountId = accountId;
    }



    public Integer getType() {
        //默认主账号
        if(type == null){
            type = 0;
        }
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getLoginToken() {
        return loginToken;
    }

    public void setLoginToken(String loginToken) {
        this.loginToken = loginToken;
    }

    public Integer getSendSmsFlag() {
        if(sendSmsFlag == null){
            sendSmsFlag = 0; //默认未发送
        }
        return sendSmsFlag;
    }

    public void setSendSmsFlag(Integer sendSmsFlag) {
        this.sendSmsFlag = sendSmsFlag;
    }

    public Integer getLoginByDefaultPassword() {
        if(loginByDefaultPassword == null){
            loginByDefaultPassword = 0; //默认为0-不是默认密码登录
        }
        return loginByDefaultPassword;
    }

    public void setLoginByDefaultPassword(Integer loginByDefaultPassword) {
        this.loginByDefaultPassword = loginByDefaultPassword;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getAccountUser() {
        return accountUser;
    }

    public void setAccountUser(String accountUser) {
        this.accountUser = accountUser;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public Integer getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Integer createTime) {
        this.createTime = createTime;
    }

    public String getManagerMobile() {
        return managerMobile;
    }

    public void setManagerMobile(String managerMobile) {
        this.managerMobile = managerMobile;
    }
}
